package org.rc.dto;

import lombok.Data;
import org.rc.entity.Mic;
import org.rc.entity.Shsp;
import org.rc.entity.Sxzj;
import org.rc.entity.SxzjChannel;

import java.util.List;

@Data
public class RoomBindSxzjAndShspRes {
    private Long roomId;

    private List<Shsp> shsps;

    private List<Mic> mics;

    private List<SxzjChannelRes> sxzjChannels;

    @Data
    public static class SxzjChannelRes{
        private String name;
        private String ip;
        private Integer port;
        private String userName;
        private String password;
        private Integer channelNo;
        private Integer rate;

        public static SxzjChannelRes getInstance(Sxzj sxzj, SxzjChannel sxzjChannel){
            SxzjChannelRes sxzjChannelRes = new SxzjChannelRes();
            sxzjChannelRes.setName(sxzjChannel.getName());
            sxzjChannelRes.setIp(sxzj.getIp());
            sxzjChannelRes.setPort(sxzj.getPort());
            sxzjChannelRes.setUserName(sxzj.getUserName());
            sxzjChannelRes.setPassword(sxzj.getPassword());
            sxzjChannelRes.setChannelNo(sxzjChannel.getChannelNo());
            sxzjChannelRes.setRate(sxzjChannel.getRate());
            return sxzjChannelRes;
        }
    }

}
